Repository navigation
Fix Environment secret forwarding and block shared-credential fallback - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Literal empty secret grants left credentials empty even when the called job selected the correct protected Environment. Generate GitHub's named secret references instead, preceded by a required caller job with no Environment that rejects nonempty repository/organization credentials under either name. Only a boolean reaches the guard process; failures block the reusable workflow. This prevents shared-secret fallback while retaining Environment-only ownership.
Real GitHub Actions verification with synthetic canaries passed all six contract cases: empty literal, omitted grant, Environment-only named reference, Environment precedence, unsafe repository fallback, and environment-free scope visibility. Evidence: https://github.com/AppSolves/codexbot/actions/runs/43602684286. Temporary synthetic secrets and Environments were removed; the probe commit is linked in docs/validation.md. No real credentials, inference or deployment were used.
Validation: Node 24
npm run check(124 tests, typecheck, lint, build), independentnpm run test:clean, actionlint for repository/generated/consumer workflows andgit diff --checkpassed. Regression tests execute the guard, reject malformed inputs, enforce dependency/permissions/boolean-only mapping and keep the manual example aligned. The previous empty-grant assertions and documentation were incorrect and are replaced.The reusable workflow and Worker authorization handlers are unchanged. Keep the existing immutable pin
4ed668864cac0682e09ec49a2515a6e1893a2780; repairing an existing caller needs no deployment, migration, OAuth reconnect or pin rollout. The generator is shared with hosted /v1/setup: future hosted setup templates require a separately authorized Worker bundle deployment, preserving this same trusted workflow pin. Existing installations must update their caller through a normal reviewed PR and freshly dispatch credential_check_only on the protected default branch. The canary test does not claim that installation's OAuth or inference success. No automatic merge or protection bypass.Concurrency regression follow-up: select the actually fulfilled Store.create result and assert its terminal transition succeeds. Related run/session claim tests also follow the winning claim, preserving one-winner, replay, rotation and authorization assertions. No production safeguards changed. Forcing the alternate contender to win reproduced the baseline failure and passed with the fix. The two affected test files passed 100/100 repetitions (1,900 test executions); full check passed 124 tests, typecheck/lint/build, and independent test:clean passed. Both independent full CI runs passed on commit 6b6b918: push, pull request. Ready for normal approval/merge. No merge, deployment, credential changes or inference is performed by this follow-up.